export const constRouter = [
  {
    // 登录
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    name: "login", // 命名路由
    meta: {
      title: "登录页",
      show: false,
      requiresAuth: false, // 是否需要权限验证
    },
  },
  {
    // 首页
    path: "/",
    component: () => import("@/views/layout/index.vue"),
    name: "layout", // 命名路由
    meta: {
      title: "Layout",
      show: true,
      requiresAuth: false,
    },
    redirect: "/home", // 重定向到home
    children: [
      {
        path: "/home",
        component: () => import("@/views/home/index.vue"),
        name: "home",
        meta: {
          title: "首页",
          show: true,
          icon: "HomeFilled",
          requiresAuth: false,
        },
      },
    ],
  },
  {
    path: "/acl",
    component: () => import("@/views/layout/index.vue"),
    name: "acl", // 命名路由
    meta: {
      title: "权限管理",
      show: true,
      icon: "Lock",
      requiresAuth: true,
    },
    // redirect: "/acl/user",
    children: [
      {
        path: "/acl/user",
        component: () => import("@/views/acl/users/index.vue"),
        name: "users",
        meta: {
          title: "用户管理",
          show: true,
          icon: "User",
          requiresAuth: true,
        },
      },
      {
        path: "/acl/role",
        component: () => import("@/views/acl/role/index.vue"),
        name: "role",
        meta: {
          title: "角色管理",
          show: true,
          icon: "UserFilled",
          requiresAuth: true,
        },
      },
      {
        path: "/acl/peimission",
        component: () => import("@/views/acl/permission/index.vue"),
        name: "peimission",
        meta: {
          title: "菜单管理",
          show: true,
          icon: "Menu",
          requiresAuth: true,
        },
      },
    ],
  },
  {
    path: "/product",
    component: () => import("@/views/layout/index.vue"),
    name: "product", // 命名路由
    meta: {
      title: "产品管理",
      show: true,
      icon: "Goods",
      requiresAuth: true,
    },
    children: [
      {
        path: "/product/attr",
        component: () => import("@/views/product/attr/index.vue"),
        name: "user",
        meta: {
          title: "属性管理",
          show: true,
          icon: "Tickets",
          requiresAuth: true,
        },
      },
      {
        path: "/product/spu",
        component: () => import("@/views/product/spu/index.vue"),
        name: "spu",
        meta: {
          title: "SPU管理",
          show: true,
          icon: "Opportunity",
          requiresAuth: true,
        },
      },
      {
        path: "/product/sku",
        component: () => import("@/views/product/sku/index.vue"),
        name: "sku",
        meta: {
          title: "SKU管理",
          show: true,
          icon: "PriceTag",
          requiresAuth: true,
        },
      },
      {
        path: "/trademark",
        component: () => import("@/views/product/trademark/index.vue"),
        name: "trademark",
        meta: {
          title: "品牌管理",
          show: true,
          icon: "Reading",
          requiresAuth: true,
        },
      },
    ],
  },
  {
    // 数据大屏
    path: "/bigscreen",
    component: () => import("@/views/bigScreen/index.vue"),
    name: "bigscreen", // 命名路由
    meta: {
      title: "数据大屏",
      show: true,
      icon: "DataLine",
      requiresAuth: false,
    },
  },
  {
    // 404
    path: "/404",
    component: () => import("@/views/404/index.vue"),
    name: "404", // 命名路由
    meta: {
      title: "404",
      show: false,
    },
  },
  {
    // 上面路由都没匹配
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    name: "any",
    meta: {
      title: "其它路由",
      show: false,
      requiresAuth: false,
    },
  },
];
